// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

#ifndef I2C_SLAVE_COMMON_H_
#define I2C_SLAVE_COMMON_H_

#include <stdint.h>
#include <stdbool.h>
#include "status/rot_status.h"

#if 0
/**
 * Defines the interface to an I2C slave
 */

struct i2c_slave_interface {
	/**
	 * Initial I2C device to slave device using provided interface
	 *
	 * @param i2c I2C slave interface to use
	 * @param DevName I2C device name (EX:I2C_0 or I2C_1)
	 * @param slave_addr I2C slave device address to setting
	 *
	 * @return Transfer status, 0 if success or an error code.
	 */
	int (*InitSlaveDev) (struct i2c_slave_interface *i2c, char *DevName, uint8_t slave_addr);
};

#define	I2C_SLAVE_ERROR(code)		ROT_ERROR (ROT_MODULE_I2C_SLAVE, code)

/**
 * Error codes that can be generated by an I2C slave driver.
 */
enum {
	I2C_SLAVE_INVALID_ARGUMENT = I2C_SLAVE_ERROR (0x00),		/**< Input parameter is null or not valid. */
	I2C_SLAVE_NO_MEMORY = I2C_SLAVE_ERROR (0x01),				/**< Memory allocation failed. */
	I2C_SLAVE_NO_DEVICE = I2C_SLAVE_ERROR (0x02),				/**< Not found device */
};

#endif

#endif /* I2C_SLAVE_COMMON_H_ */
